<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<%@include file="../common.jsp"%>
<title>广告管理</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css" href="resources/css/common.css">
<script type="text/javascript" src="resources/js/framejs/jquery.form.js"></script>
<script type="text/javascript" src="resources/js/ads.js"></script>
<style>
.house{
	cursor:pointer;
}
</style>
</head>
<body>
	<div class="content">
		<h4>广告管理</h4>
		<hr />
		<!-- 工具栏 -->
		<div class="tools">
			<button id="btn_add" type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal_add"><i class="icon icon-plus"></i> 新增</button>
			<button id="btn_edit" type="button" class="btn btn-warning"><i class="icon icon-edit"></i> 修改</button>
			<button id="btn_del" type="button" class="btn btn-danger"><i class="icon icon-minus"></i> 删除</button>
			<button id="btn_refresh" type="button" class="btn btn-primary"><i class="icon icon-arrow-up"></i> 置顶</button>
			<button id="btn_scan" type="button" class="btn btn-success"><i class="icon icon-bars"></i> 查看当前广告</button>
			<!-- 
	    	<div id="btn_type" class="btn-group" style="float: right;">
			  	<button type="button" class="btn btn-default active" id="0">欢迎页广告</button>
			  	<button type="button" class="btn btn-primary" id="1">banner广告</button>
			</div> -->
		</div>
		<!-- 列表 -->
		<table id="tab_list" class="table table-hover table-striped mytable">
			<thead>
				<tr>
					<th style="width: 10%;"><input id="pkall" type='checkbox'class='checkbox'></th>
					<th style="width: 10%;">序号</th>
					<th style="width: 40%;">图片</th>
					<th style="width: 40%;">外链</th>
				</tr>
			</thead>
			<tbody>

			</tbody>
		</table>
		<!-- 分页信息条 -->
		<div id="pagebar" class="pagebar">
			<ul class="pager">

			</ul>
			<p id="page_info" class="page_info">
				显示第<span>0</span>到第<span>0</span>条记录,共<span>0</span>条
			</p>
		</div>
	</div>

	<!-- 增加 -->
	<div class="modal fade bs-example-modal-lg" id="modal_add"
		tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
		aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">新增广告信息</h4>
				</div>
				<div class="modal-body">
					<form id="form_add" class="form-horizontal" role="form">
						<div class="form-group">
							<label class="col-sm-2 control-label required">广告链接</label>
							<div class="col-sm-10">
								<input type="text" name="external_url" class="form-control"
									placeholder="广告链接" data-toggle="tooltip" data-placement="top"
									title="请输入广告链接">
							</div>
						</div>
					</form>
					<form id="form_add2" class="form-horizontal" action="common/upload"
						method="post" enctype="multipart/form-data">
						<div class="form-group">
							<label class="col-sm-2 control-label required">广告图片</label>
							<div class="col-sm-10">
								<input type="file" name="file" placeholder="请选择图片..."
									data-toggle="tooltip" data-placement="top" title="请上传图片文件">
							</div>
						</div>
						<div class="form-group" style="display:none;">
							<div class="col-sm-2"></div>
							<div class="col-sm-10">
								<a href="" target="_blank"> <img id="logo_scan" alt=""
									src="" style="height: 150px;"> </a>
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button id="btn_confirm_add" type="button" class="btn btn-primary">确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 修改 -->
	<div class="modal fade bs-example-modal-lg" id="modal_edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span> <span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">修改广告信息</h4>
				</div>
				<div class="modal-body">
					<form id="form_edit" class="form-horizontal" role="form" action="ads/modify" method="post">
						<input type="hidden" id="edit_id" name="id">
						<div class="form-group">
							<label class="col-sm-2 control-label">广告链接*</label>
							<div class="col-sm-10">
								<input type="text" name="external_url_edit" class="form-control" id="external_url_edit"
								   data-toggle="tooltip" data-placement="top" title="请输入广告链接">
							</div>
						</div>
					</form>
					<form id="form_edit2" class="form-horizontal" action="common/upload" method="post" enctype="multipart/form-data">
						<div class="form-group">
							<label class="col-sm-2 control-label required">广告图片</label>
							<div class="col-sm-10">
								<input type="file" name="file" placeholder="请选择图片..."
									data-toggle="tooltip" data-placement="top" title="请上传图片文件">
							</div>
						</div>
						<div class="form-group" style="display:none;">
							<div class="col-sm-2"></div>
							<div class="col-sm-10">
								<a href="" target="_blank">
									<img id="logo_scan2" alt="" src="" style="height: 150px;"> 
								</a>
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button id="btn_confirm_edit" type="button" class="btn btn-primary">确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>

	<!-- 预览单个广告详情  -->
	<div class="modal fade bs-example-modal-lg" id="modal_scan" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" id="preview_close">
						<span aria-hidden="true">&times;</span> <span class="sr-only" >Close</span>
					</button>
					<h4 class="modal-title">广告详情</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" role="form">
					<input type="hidden" name="asd_id" id="asd_id">
						<div class="form-group">
							<label class="col-sm-2 control-label">广告链接*</label>
							<div class="col-sm-10">
								<input type="text" name="external" class="form-control" id="external" required="required" disabled="disabled">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">广告图片*</label>
							<div class="col-sm-10">
								<a href="" target="_blank">
									<img id="ads_scan" title="点击查看原图" alt="" src="" style="height: 150px;">
								</a>
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" data-dismiss="modal" id="preview_ok" >确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal" id="preview_cancel">取消</button>
				</div>
			</div>
		</div>
	</div>
	
	<!-- 预览广告详情  -->
	<div class="modal fade bs-example-modal-lg" id="modal_lunbo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog modal-lg" style="height:550px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span> <span class="sr-only" >Close</span>
					</button>
					<h4 class="modal-title">当前app可看到的广告</h4>
				</div>
				<div class="modal-body" style="height:400px;"></div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" data-dismiss="modal" >确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal" >取消</button>
				</div>
			</div>
		</div>
	</div>
</body>
</html>